import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import LoginView from '@/views/LoginView.vue'
import DetailsView from '@/views/DetailsView.vue'
import ConditionView from '@/views/ConditionView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/home',
    name: 'home',
    component: HomeView,
    children:[{
      path:'/home/student/find',
      name:'student',
      component:()=>import('../views/student/StudentView.vue')
    },
    // 学员状态
    {
      path:'/home/condition',
      name:'condition',
      component: ConditionView
    },
    // 学员详情
    {
      path:'/home/details',
      name:'details',
      component: DetailsView
    }
  ]
      
    
  },
  {
    path: '/',
    name: 'login',
    component: LoginView
  },
    // path: '/about',
    // name: 'about',
    // // route level code-splitting
    // // this generates a separate chunk (about.[hash].js) for this route
    // // which is lazy-loaded when the route is visited.
    // component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
